﻿// 系统中表示树形结构的控件
Ext.define('Kwan.ex.TreePanel', {
    extend: 'Ext.tree.Panel',
    singleExpand: true,
    rootVisible: false,
    loadMask: true,
    isGrid: false, // 如果不为空，就是TreeGrid
    ajaxUrl: '', // 请求数据的地址
    modelName: '', // Model名称
    operBar: {},
    selectedId: '',
    initComponent: function () {
        var model = null, text = '.';
        if (this.isGrid) {
            model = this.modelName;
            text = 'root';
        }
        this.store = Ext.create('Ext.data.TreeStore', {
            model: model,
            proxy: {
                type: 'ajax',
                url: this.ajaxUrl
            }
            //root: {
            //    text: text,
            //    id: 'root',
            //    expanded: false
            //},
            //folderSort: true
        });
        //this.tbar = this.operBar;
        this.callParent(arguments);
    }
});